<?php

namespace App\Http\Requests\Validators\Frontend\Demand;

use App\Http\Requests\Validators\BaseValidator;

class DemandValidator extends BaseValidator
{
    public function storeRules()
    {

        return [
            'title' => 'required | string | max:255',
            'province_id' => 'required | numeric',
            'city_id' => 'required | numeric',
            'area_id' => 'required | numeric',
            'budget' => 'required | numeric',
            'introduction' => 'string',
            'negotiate' => 'required | in:1,2',
            'deadline' => 'required | date_format:Y-m-d H:i:s',
        ];
    }

    public function editRules()
    {

        return [
            'title' => 'string | max:255',
            'province_id' => 'numeric',
            'city_id' => 'numeric',
            'area_id' => 'numeric',
            'budget' => 'numeric',
            'introduction' => 'string',
            'negotiate' => 'in:1,2',
            'deadline' => 'date_format:Y-m-d H:i:s',
        ];
    }

    public function searchRules()
    {

        return [
            'title' => 'string | max:255',
            'province_id' => 'numeric',
            'city_id' => 'numeric',
            'area_id' => 'numeric',
            'budget' => 'numeric',
            'introduction' => 'string',
            'negotiate' => 'in:1,2',
            'deadline' => 'date_format:Y-m-d H:i:s',
            'begin_time' => 'date_format:Y-m-d H:i:s',
            'end_time' => 'date_format:Y-m-d H:i:s',
        ];
    }
}
